<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class Bonus_model
{
    /*
     * UNTUK MENGHITUNG AKTIVASI
     */
    
    public $db;
    public function __construct() {
        $this->db=Yii::app()->db;
    }
    
    public function member_activation($data_arr)
    {
        $this->db->select($data_arr['select']);
	$this->db->from('sys_network_level_status_log');
        if($data_arr['where']!='')
        {
            $this->db->where($data_arr['where'],$data_arr['params']);
        }
	       //  array('not in','network_level_status_log_value','passive'),
               // array('>=','date(network_level_status_log_datetime)',$start_daily)
        if(isset($data_arr['group']) AND trim($data_arr['group'])!='')
        {
            $this->db->group($data_arr['group']);
        }
        if(isset($data_arr['order']) AND trim($data_arr['order'])!='')
        {
            $this->db->order($data_arr['order']);
        }

        return $this;
    }

}


?>
